Carbon


GetSubTable

Header: Quickdraw.h Carbon status: Supported

Searches one color table for the best matches to colors in another color table. Your application should not need to call this function; it is used by system software only.

void GetSubTable (
    CTabHandle myColors, 
    SInt16 iTabRes, 
    CTabHandle targetTbl
);
Parameter descriptions
myColors

A handle to a color table containing the colors for which you want matches.

iTabRes

The resolution of the inverse table to be used.

targetTbl

A handle to a color table whose colors are to be matched. If you supply NULL for targetTbl, then the Color Manager searches the current GDevice data structure’s CLUT, and uses its inverse table. Otherwise a temporary inverse table is built, with a resolution of the value in the iTabRes parameter.

DISCUSSION

The Color Manager uses the Color2Index function for each RGBColor data structure in the color table of the myColors parameter. It determines the best match in the target table and stores that index value in the value field of the color table of the myColors parameter.

Depending on the requested resolution, building the inverse table can require large amounts of temporary space in the application heap: twice the size of the table itself, plus a fixed overhead of 3–15 KB for each inverse table resolution.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)